package chapter16;

import org.junit.Test;

import java.util.Arrays;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/11/3 18:17
 */
public class ArrayCopyTest {
    @Test
    public void testArrayCopy() {
        Integer[] a = {1, 2, 3, 4, 5};
        int[] b = new int[10];
        // illigal 会报错，因为下面的拷贝不会提供自动拆箱和装箱功能
        System.arraycopy(a, 0, b, 5, a.length);
        System.out.println(Arrays.toString(b));
    }
}
